#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main()
{
	int n;
	scanf("%d", &n);
	int conut = 0;
	while (n)
	{
		n = n & (n - 1);
		conut++;
	}
	printf("%d", conut);
	return 0;
}